import http from '@/utils/http'
const pre = 'activity-management'
// 分页获取广告信息
export const getAdverList = (params) => {
  const url = `/${pre}/advert-management/selectByPage`
  return http.post(url, params)
}

// 获取广告信息详情
export const selectDetail = (params) => {
  const url =
    '/activity-management/advert-management/advertDetail-management/selectDetailById'
  return http.post(url, params)
}

// 删除广告
export const deleteAdvert = (params) => {
  const url = `/${pre}/advert-management/deleteById`
  return http.post(url, params)
}

//下线广告
export const downOrUpAdvert = (params) => {
  const url = `/${pre}/advert-management/downOrUpAdvert`
  return http.post(url, params)
}

// 新增广告
export const insertAdvert = (params) => {
  const url =
    '/activity-management/advert-management/advertCreate-management/insertAdvert'
  return http.post(url, params)
}

// 分页获取电站信息(添加广告时用)
export const getStationInAdvert = (params) => {
  const url = `/${pre}/advert-management/selectStationPage`
  return http.post(url, params)
}

// 编辑广告
export const updateAdvert = (params) => {
  const url =
    '/activity-management/advert-management/advertCreate-management/updateById'
  return http.post(url, params)
}

//获取统计广告头部
export const getStatisticAdvertHeader = (params) => {
  const url =
    '/activity-management/advert-management/advertStatistic-management/getStatisticAdvertHeader'
  return http.post(url, params)
}

//获取广告记录详情
export const getAdvertLogList = (params) => {
  const url =
    '/activity-management/advert-management/advertStatistic-management/getAdvertLogList'
  return http.post(url, params)
}

export const activityList = (params) => {
  const url = `/${pre}/activityList-management/selectActivityPage`
  return http.post(url, params)
}
export const actDownLine = (params) => {
  const url = `/${pre}/activityList-management/actDownLine`
  return http.post(url, params)
}
export const actStation = (params) => {
  const url = `/${pre}/activityList-management/queryActStation`
  return http.post(url, params)
}
export const activityDetail = (params) => {
  const url = `/${pre}/activityList-management/activityDetail-management/getActivityDetail`
  return http.post(url, params)
}
export const createAct = (params) => {
  const url = `/${pre}/activityList-management/activityCreate-management/createAct`
  return http.post(url, params)
}
export const updateAct = (params) => {
  const url = `/${pre}/activityList-management/activityCreate-management/updateAct`
  return http.post(url, params)
}
export const selectMerchant = (params) => {
  const url = `/${pre}/activityList-management/activityCreate-management/selectMerchant`
  return http.post(url, params)
}
export const exportActDetail = (params) => {
  const url = `/${pre}/activityList-management/activityDetail-management/exportActDetail`
  return http.get({
    url: url,
    params: params,
    responseType: 'blob',
  })
}
//外部活动
export const externalActivityList = (params) => {
  const url = `/${pre}/externalActivity-management/queryList`
  return http.post(url, params)
}
export const offLineExActivity = (params) => {
  const url = `/${pre}/externalActivity-management/offLineExActivity`
  return http.post(url, params)
}
export const systemUserList = (params) => {
  const url = `/${pre}/externalActivity-management/createOrUpdate/systemUserList`
  return http.post(url, params)
}
export const merchantStationList = (params) => {
  const url = `/${pre}/externalActivity-management/createOrUpdate/merchantStationList`
  return http.post(url, params)
}
export const insertExActivity = (params) => {
  const url = `/${pre}/externalActivity-management/createOrUpdate/insertExActivity`
  return http.post(url, params)
}
export const updateExActivity = (params) => {
  const url = `/${pre}/externalActivity-management/createOrUpdate/updateExActivity`
  return http.post(url, params)
}
export const selectExternalActivityDetail = (params) => {
  const url = `/${pre}/externalActivity-management/detail/selectExternalActivityDetail`
  return http.post(url, params)
}
export const sendCardList = (params) => {
  const url = `/${pre}/externalActivity-management/detail/sendCardList`
  return http.post(url, params)
}
export const exportSendTimeCard = (params) => {
  const url = `/${pre}/externalActivity-management/detail/exportSendTimeCard`
  return http.post(url, params)
}
